package com.ruoyi.server.api.venueManagement.service.impl;

import java.util.List;

import com.ruoyi.common.core.domain.model.LoginUser;
import com.ruoyi.common.utils.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.server.api.venueManagement.mapper.VenueManagementMapper;
import com.ruoyi.server.api.venueManagement.domain.VenueManagement;
import com.ruoyi.server.api.venueManagement.service.IVenueManagementService;

/**
 * 场馆管理理Service业务层处理
 * 
 * @author hjh
 * @date 2024-06-12
 */
@Service
public class VenueManagementServiceImpl implements IVenueManagementService 
{
    @Autowired
    private VenueManagementMapper venueManagementMapper;

    /**
     * 查询场馆管理理
     * 
     * @param id 场馆管理理主键
     * @return 场馆管理理
     */
    @Override
    public VenueManagement selectVenueManagementById(Long id)
    {
        return venueManagementMapper.selectVenueManagementById(id);
    }

    /**
     * 查询场馆管理理列表
     * 
     * @param venueManagement 场馆管理理
     * @return 场馆管理理
     */
    @Override
    public List<VenueManagement> selectVenueManagementList(VenueManagement venueManagement)
    {
        return venueManagementMapper.selectVenueManagementList(venueManagement);
    }

    /**
     * 新增场馆管理理
     * 
     * @param venueManagement 场馆管理理
     * @return 结果
     */
    @Override
    public int insertVenueManagement(VenueManagement venueManagement)
    {
        return venueManagementMapper.insertVenueManagement(venueManagement);
    }

    /**
     * 修改场馆管理理
     * 
     * @param venueManagement 场馆管理理
     * @return 结果
     */
    @Override
    public int updateVenueManagement(VenueManagement venueManagement)
    {
        return venueManagementMapper.updateVenueManagement(venueManagement);
    }

    /**
     * 批量删除场馆管理理
     * 
     * @param ids 需要删除的场馆管理理主键
     * @return 结果
     */
    @Override
    public int deleteVenueManagementByIds(Long[] ids)
    {
        return venueManagementMapper.deleteVenueManagementByIds(ids);
    }

    /**
     * 删除场馆管理理信息
     * 
     * @param id 场馆管理理主键
     * @return 结果
     */
    @Override
    public int deleteVenueManagementById(Long id)
    {
        return venueManagementMapper.deleteVenueManagementById(id);
    }

    /**
    * @Author hjh
    * @Description 获取场馆最大人数
    * @Date 2024/6/12 20:19
    * @Return com.ruoyi.server.api.venueManagement.domain.VenueManagement
    */
    @Override
    public VenueManagement getVenueMaxNumber() {
        LoginUser loginUser = SecurityUtils.getLoginUser();
        String venueUniqueIdentifier = loginUser.getUser().getVenueUniqueIdentifier();
        VenueManagement venueMaxNumber = venueManagementMapper.getVenueMaxNumber(venueUniqueIdentifier);
        return venueMaxNumber;
    }
}
